package com.zkzx.util.redis;

import org.apache.commons.lang3.StringUtils;

/**
 * 北京中科智兴物联科技有限公司 @版权所有
 *
 * @Author: zhaoyihe@zkraising.com
 * @Date: 2021/05/18/18:50
 * @Description:
 */
public class CacheKeyUtil {

    private static final String CAPTCHA = "CAPTCHA_";
    private static final String UNDERLINE = "_";

    /**
     * 获取验证码key
     * @param type 业务类型字符串
     *        phone 电话号码
     * @return key
     */
    public static String getCaptcha(String type,String phone) {

        if (StringUtils.isBlank(type) && StringUtils.isBlank(phone)){
            return null;
        }
        return CAPTCHA.concat(type).concat(UNDERLINE).concat(phone);
    }


}
